package com.aaa.service;

import com.aaa.dao.MoneyRecordDao;
import com.aaa.pojo.MoneyRecord;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class MoneyRecordService {
    @Autowired
    private MoneyRecordDao moneyRecordDao;
//    //查询资金记录
//    public List<MoneyRecord> selectAll(){
//        return moneyRecordDao.selectAll();
//    }
    //查询资金记录  分页
    public PageInfo<MoneyRecord> getChangeByPages(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);//表示从pageNum页开始，每页pageSize条数据
        List<MoneyRecord> moneyRecords = moneyRecordDao.selectAll();
        PageInfo<MoneyRecord> pageInfo = new PageInfo<>(moneyRecords);
        return pageInfo;
    }
}
